Skip to content

ism330dl: Use polling with timeout in _ensure_data().#128

Merged
nedseb merged 2 commits intomainfrom
fix/ism330dl-polling-timeout
Mar 14, 2026
Merged

ism330dl: Use polling with timeout in _ensure_data().#128
nedseb merged 2 commits intomainfrom
fix/ism330dl-polling-timeout

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Mar 14, 2026

Closes #125

Summary

Replace sleep_ms(100) with polling of STATUS_REG for XLDA bit and OSError on timeout, consistent with the pattern used by WSEN-HIDS, LIS2MDL, VL53L1X, and APDS9960.

Test plan

python3 -m pytest tests/ -k "ism330dl and mock" -v  # 31 passed

@nedseb nedseb requested a review from Copilot March 14, 2026 22:04
@nedseb nedseb self-assigned this Mar 14, 2026
@nedseb nedseb added the bug Something isn't working label Mar 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the ISM330DL driver’s auto-trigger wakeup path to wait for data-ready via STATUS_REG polling (with a timeout) instead of using a fixed sleep_ms(100), aligning behavior with other drivers in the repository.

Changes:

  • Replaced fixed delay in ISM330DL._ensure_data() with polling of REG_STATUS_REG for STATUS_XLDA (up to 50×10ms) and an OSError on timeout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/ism330dl/ism330dl/device.py
Comment thread lib/ism330dl/ism330dl/device.py
@nedseb nedseb merged commit 612f4bb into main Mar 14, 2026
3 checks passed
@nedseb nedseb deleted the fix/ism330dl-polling-timeout branch March 14, 2026 22:19
@semantic-release-updater
Copy link
Copy Markdown

🎉 This PR is included in version 0.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ism330dl: Use polling with timeout in _ensure_data() for consistency.

2 participants